package com.example.weektwo;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.example.weektwo.async02.VideoPlarerActivity;
import com.example.weektwo.async03.ShowVideoPlarerActivity;
import com.example.weektwo.login.LoginActivity;
import com.example.weektwo.requestpermission.CallActivity;

public class HomeActivity extends AppCompatActivity implements View.OnClickListener {
    Button btn_app,btn_video,btn_show_video,btn_call;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_home);
        btn_app=findViewById(R.id.button1);
        btn_video=findViewById(R.id.button2);
        btn_show_video=findViewById(R.id.button3);
        btn_app.setOnClickListener(this);
        btn_video.setOnClickListener(this);
        btn_show_video.setOnClickListener(this);
        btn_call=findViewById(R.id.button4);
        btn_call.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent = new Intent();
        switch (v.getId()) {
            case R.id.button1:
                intent.setClass(this, LoginActivity.class);
                break;
            case R.id.button2:
                intent.setClass(this, VideoPlarerActivity.class);
                break;
            case R.id.button3:
                intent.setClass(this, ShowVideoPlarerActivity.class);
                break;
            case R.id.button4:
                intent.setClass(this, CallActivity.class);
                break;
        }
        startActivity(intent);
    }
}
